VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "Loader"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
'***************************************************
' Property Variables of Loader class
'***************************************************
' This class is connected to the AfterNewProject FileControl
' event and does the actual job of loading the previous project.

Public VBInstance As VBIDE.Application
Public NewProjectName As String
Public Sub AfterNewProject(projectname As String)

Dim PrjTemplate As ProjectTemplate
Static bDone As Boolean

If Not bDone And FileExists(NewProjectName$) Then
  bDone = True 'Prevent endless loop
  Set PrjTemplate = VBInstance.Application.LoadProject(NewProjectName$, True)
End If

End Sub

Function FileExists(filename As String) As Integer

Dim i As Integer
On Error Resume Next

i = Len(Dir$(filename))
FileExists = Not Err And Not (i = 0)

End Function
